package com.fyt.controller.user.account;

import com.alibaba.fastjson.JSONObject;
import com.fyt.controller.utils.Result;
import com.fyt.service.user.account.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
@Api(tags="登录模块")
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @ApiOperation("检查账号密码返回token")
    @PostMapping("/api/user/account/login")
    public Result getToken(@RequestBody Map<String,String>map){
        String account = map.get("account");
        String password = map.get("password");
        return loginService.getToken(account,password);
    }
}
